package sg.edu.nus.iss.jass.dao;

import java.util.ArrayList;
import java.util.List;

import sg.edu.nus.iss.jass.model.CompanyDTO;

/**
 * @version 1.0
 * @author SE19 Team 1
 * 
 */
public class CompanyDAO extends PropertiesDAO {
	
	public static String pathname = "properties/company.properties";
	
	// Class Constructor.
	public CompanyDAO() {
		super(pathname, CompanyDTO.class);
	}
	
	public CompanyDTO getCompany(String id) {
		return (CompanyDTO)this.getObject(id);
	}
	
	public List<CompanyDTO> getCompanyList() {
		List<CompanyDTO> companies = new ArrayList<CompanyDTO>();
		
		for(int n = 0; n < getTotal(); n++) {
			String strId = String.valueOf(n + 1);
			companies.add(getCompany(strId));
		}
		return companies;
	}
}
